package no.ntnu.fp.messages.impl;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import no.ntnu.fp.messages.Message;
import no.ntnu.fp.messages.MessageCode;
import no.ntnu.fp.utils.XmlParser;

public class LogoutSuccessfulMessage implements Message {
	
	@Override
	public String toString(){
		Document dom = XmlParser.getThreadLocalDocumentBuilder().newDocument();
		Element element = dom.createElement("message");
		return getMessageCode() + "" + XmlParser.convertXmlToString(element);
	}

	@Override
	public MessageCode getMessageCode() {
		return MessageCode.LOGOUT_SUCCESSFUL_MESSAGE;
	}

	@Override
	public Message fromXmlString(String xml) {
		return new LogoutSuccessfulMessage();
	}

}
